package com.ch03;

/*
 * This class illustrates constructors
 */
public class Constructors {
	public Constructors() {
		System.out.println("In parent construtor");
	}
	
	public int subtract(int no1, int no2) {
		System.out.println("In subtract method of parent " + no1 + "," + no2);
		return no1-no2;
	}
	
	public double subtract(double no1, double no2) {
		System.out.println("In subtract 2 method of parent " + no1 + "," + no2);
		return no1-no2;
	}
	
	public double subtract(double no1, int no2) {
		System.out.println("In subtract 2 method of parent " + no1 + "," + no2);
		return no1-no2;
	}
	
	private double divide(double no1, double no2) {
		return no1 / no2;
	}
	
	public static void main(String args[]) {
		Constructors obj = new Constructors();
		Constructors obj2 = new Constructors();
		
		System.out.println(obj.subtract(20, 10));
	}
}
